<?php
global $db, $products, $articles, $lg, $main_title, $cat; 

//seo
$sql = "select title_vn, title_en, keyword_vn, keyword_en, des_vn, des_en, has_child, comp, id, name_vn, name_en, unique_key_vn, unique_key_en, seo_f_vn, seo_f_en from categories where comp=5";
$cat = $db->getRow($sql);

$title_page = $cat["title_$lg"];
$keywords = $cat["keyword_$lg"];
$descriptions = $cat["des_$lg"];

$sql = "SELECT id, name_vn, name_en, size, price, production_vn, production_en, unique_key_vn, unique_key_en, img, cid, seo_f_vn, seo_f_en, view FROM products ORDER BY home DESC, home_order ASC LIMIT 0,9";
$products = $db->getAll($sql);

if($products == null){
	$sql = "select name_vn, name_en, short_vn, short_en, unique_key_vn, unique_key_en, cid, seo_f_vn, seo_f_en, title_vn , title_en, keyword_vn, keyword_en, des_vn, des_en, id, img, view, dated from articles where name_$lg<>'' order by home desc, id desc limit 0,5";
	$articles = $db->getAll($sql);
}

$r = Info::getRow("main title $lg");
$main_title = $r["plain_text_vn"];
$tpl="list";


?>
